<form action="" method="post" id="packageForm">
<div>
    <input type="button" name="initAttr" value="<?php echo $this->translate("saveBtn"); ?>" onclick="javascript:Order.addPackage('<?php echo HttpUtil::baseUrl();?>', '<?php echo $this->id; ?>');" />
    <input type="button" name="cancel" value="<?php echo $this->translate("cancelBtn"); ?>" onclick="javascript:$('#package_dialog').dialog('close');" />
</div>
<br />
<div style="width:500">
	<fieldset>
		<div class='form_line_div'>
		    <input type="hidden" name="orderId" value="<?php echo $this->id; ?>" >
			<div class='form_element_label'><?php echo $this->translate("trackNumber"); ?></div>
		    <div class="form_element"><input id="trackNumber" type="text" value="" name="trackNumber"  /></div>
		    <div class='form_element_label'><?php echo $this->translate("shippingMethod"); ?></div>
		    <div class="form_element">
		    	<select id="shippingMethod" name="shippingMethod">
		    		<?php 
		    		    $shippingMethod = OrderConstant::getShippingMethodList();
		    		    foreach($shippingMethod as $key=> $method){
		    		        echo "<option value=\"$key\">".$method."</option>";
		    		    }
		    		?>
	            </select>
			</div>
		</div>
	</fieldset>
	<fieldset>
        <div class='form_line_div'>
            <div class='form_element_label'><?php echo $this->translate("status"); ?></div>
            <div class="form_element">
	            <select id="status" name="status">
                    <option value="0"><?php echo OrderConstant::getPackageStatus(0) ?></option>
                    <option value="1"><?php echo OrderConstant::getPackageStatus(1) ?></option>
	            </select>
            </div>
        </div>
    </fieldset>
    <fieldset>
        <div class="dbgrid_center_right">
            <table cellpadding="0" cellspacing="0" width="90%">
                <tr>
                    <td class="dbgrid_th"><?php echo $this->translate("upc"); ?></td>
                    <td class="dbgrid_th"><?php echo $this->translate("title"); ?></td>
                    <td class="dbgrid_th"><?php echo $this->translate("attribute"); ?></td>
                    <td class="dbgrid_th"><?php echo $this->translate("qty"); ?></td>                    
                </tr>
                
                <?php foreach ($this->results as $result) { ?>
                <tr>
                    <td class="dbgrid_td"><?php echo $result['upc']; ?></td>
                    <td class="dbgrid_td"><?php echo $result['title']; ?></td>
                    <td class="dbgrid_td">
                    
                        <?php if (! empty($result['value_1'])) {?>
		                <div align="center"><span><?php echo $result['attribute_1']; ?>:<label><?php echo $result['value_1']; ?></label></span></div>
		                <?php } ?>
		                
		                <?php if (! empty($result['value_2'])) {?>
		                <span><div align="center"><?php echo $result['attribute_2']; ?>:<label><?php echo $result['value_2']; ?></label></div></span>
		                <?php } ?>
		                
		                <?php if (! empty($result['value_3'])) {?>
		                <span><div align="center"><?php echo $result['attribute_3']; ?>:<label><?php echo $result['value_3']; ?></label></div></span>
		                <?php } ?>
		                
		                <?php if (! empty($result['value_4'])) {?>
		                <span><div align="center"><?php echo $result['attribute_4']; ?>:<label><?php echo $result['value_4']; ?></label></div></span>
		                <?php } ?>
		                
		                <?php if (! empty($result['value_5'])) {?>
		                <span><div align="center"><?php echo $result['attribute_5']; ?>:<label><?php echo $result['value_5']; ?></label></div></span>
	                    <?php } ?>
                    </td>
                    <td class="dbgrid_td">
                        <input type="text" name="qty[]" value="<?php echo $result['quantity']; ?>"  readonly />
                        <input type="hidden" name="id[]" value="<?php echo $result['oiid']; ?>" />
                    </td>
                </tr>
                <?php } ?>
                
            </table>
        </div>
    </fieldset>
</div>
</form>